package com.itmiaojie.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itmiaojie.mapper.RoleMapper;
import com.itmiaojie.pojo.Role;
import com.itmiaojie.service.RoleService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 *
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role>
    implements RoleService {

    @Override
    public List<String> selectUserRoleById(Long userId) {
        if (userId == 1L){//如果为管理管直接返回admin
            List<String> roles = new ArrayList<>();
            roles.add("admin");
            return roles;
        }
        //否则根据id查询所具有的角色信息
        return baseMapper.selectUserRoleById(userId);
    }
}




